package iq.logger;


import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

public class TestLog4j {

	static {
		//DOMConfigurator.configure("src/log4j.xml");
		PropertyConfigurator.configure("src/log4j.properties");
	}
	public static Logger getLogger(String str) {
		Logger logger = Logger.getLogger(str);
		return logger;
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Logger logger = TestLog4j.getLogger(TestLog4j.class.getName());
		Logger x = TestLog4j.getLogger(TestLog4j.class.getName());
		Logger y = TestLog4j.getLogger(String.class.getName());
		Logger z = TestLog4j.getLogger("logger");
		Logger m = TestLog4j.getLogger("logger");
		
		System.out.println(logger);
		System.out.println(x);
		System.out.println(y);
		System.out.println(z);
		System.out.println(m);
		//PropertyConfigurator.configure("src/log4j.prop");
		//File file = new File("log4j.prop");
		try {
			//file.createNewFile();
			Integer.parseInt("");
		} catch (Exception e) {
			// TODO 自动生成 catch 块
			//e.printStackTrace();
			logger.debug(e);
			logger.info(e);
			logger.warn(e);
			logger.error(e);
			logger.fatal(e);
			
			
//			y.debug(e);
//			y.info(e);
//			y.warn(e);
//			y.error(e);
//			y.fatal(e);
		}

	}

}
